<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--第一，Controller传参-->
<h1 th:text="${data}">thieves</h1>
<!--第二，Controller传对象及属性-->
<h2 th:text="${user}">空</h2>
<span th:text="${user.id}">空</span>
<span th:text="${user.username}">空</span>
<span th:text="${user.age}">空</span>
<br><br>
<!--第三，网页传参数给Controller-->
<h1>---------------------------------</h1>
<h3>第三</h3> <a th:href="@{/test3(id=${user.id},age=${user.age},name=${user.username})}"> 网页传参数给Controller </a>
<br><br>
<h1>---------------------------------</h1>
<h3>第四</h3> <a th:href="@{/test4(id=${user.id},age=${user.age},name=${user.username})}"> src问题 </a>

<br><br>
<h1>---------------------------------</h1>
<h1>th:onclick 的使用</h1>
<!--目前 thymeleaf 版本要求只能传递数字和布尔值-->
<a th:onclick="'show('+${user.id}+')'">点击：显示学生编号</a>
<script type="text/javascript">
    function show(id) {
        alert("用户编号为：" + id);
    }
</script>

<h1>---------------------------------</h1>
<h1>th:style 的使用</h1>
<a th:onclick="'show('+${user.id}+')'"
   th:style="'font-size:40px;color:red;'">点击：显示学生编号</a>
</body>

<h1>---------------------------------</h1>
<h1>th:from,th:placeholder,th:value 的使用</h1>
<!--<form th:action="@{/from}" method="post">-->
<!--(input1=${user.username},input2=${input2})-->
<form th:action="@{/form}" method="get">
    <input type="text" name="input1" th:placeholder="${user.username}">
    <input type="text" name="input2" >
    <button type="submit">提交</button>
    <button type="reset">清空</button>
</form>


</html>